This XCMD will quickly draw a number of PICT resources to the screen. To convert your art to PICT resources, see ClipToPICTRes*.
People are encouraged to use these freely, but they will not be supported.
If anyone is interested in the source code, or have questions, they can
contact me at:
High Performance Systems
13 Dartmouth College Hwy
Lyme, NH 03768
Attn: Michael McClennen
(603)-795-4857
Michael is another of those loyal Developer Stack devotees who received the latest issue free because he donated this XCMD to the stack. Thanks, Mike. [Editor]
-- part contents for background part 10
----- text -----
Syntax:
DrawPict <screenrect>,<picturespecs>...
Screenrect consists of four coordinates, separated either by spaces or by commas. They designate the rectangle of the card to be affected by this XCMD.
The remaining parameters (up to 15) are lists of picture specifications. Each list consists of one or more picture specs separated by carriage returns. Each consists of a name and either two or four coordinates. If two, then the PICT resource with the given name will be drawn with its top left corner at the given point. If four, the picture will be drawn scaled to that rectangle.
A coordinate may be any valid HyperCard expression which does not contain a space or a comma (even in literals). If a coordinate contains other than numeric digits, the XCMD will call back to HyperCard to evaluate it.
Result:
The PICT resources named will be drawn in order on a white background offscreen and the result will be copied onto the current card clipped to the rectangle given in the first parameter. If there is not enough memory or the first parameter does not contain a valid rectangle, the XCMD will do nothing. Otherwise it will draw the white background and as many pictures as are valid. A picture specification which is invalid for any reason (no PICT resource of that name found, invalid rectangle, coordinates out of the screen rectangle) will simply be skipped.
NOTE: HyperCard does not know anything about this XCMD. The next time anything is drawn on the screen (if you choose any tool or move any button or field, or if a dialog box comes up, or if you go to another card, etc...) the pictures will be overwritten. If you want a picture to stay around staticly, the best way I have found to do so is to put in an idle handler to draw it every 30 ticks or so. That way it comes back as soon as it is overwritten. I intended this XCMD mostly for animation, in whch case it should be executed often to draw the picture in different positions, different sizes, etc. Note that it will itself overwrite all buttons, fields, HyperCard graphics, etc.